package com.yzd.learnjava.strings;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.yzd.learnjava.util.Print;
/*
 * Matcher/Pattern
 */
public class Resetting {

	public static void main(String[] args) {
		Matcher m = Pattern.compile("[frb][aiu][gx]").matcher("fix the rug with bags");
		while(m.find()) {
			Print.printnb(m.group() + " ");
		}
		Print.print();
		m.reset("fix the rig with bags");
		while(m.find()) {
			Print.printnb(m.group() + " ");
		}
	}

}
